import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import App from './App.vue'
import router from './router/index';
import 'element-plus/dist/index.css'
import './index.css'
import "./style/elreset.less";
import "./style/cssreset.css";
import "./style/public.less";
// 字体图标库
import "./iconfont/iconfont.css";
import "./iconfont/font/iconfont.css";
//挂载全局变量
import $utils from './utils/index';
//国际化
import zhCn from 'element-plus/dist/locale/zh-cn.mjs'

import {createPinia} from 'pinia'
//持久化
import piniaPluginPersist from 'pinia-plugin-persistedstate'
import guard from '@/router/guard';

import echarts from '@/echarts/echarts';

// 创建 Pinia 实例
const pinia = createPinia()
pinia.use(piniaPluginPersist);
const app = createApp(App)
// 挂载到 Vue 根实例

app.use(pinia) 
// 等pinia挂载之后执行, 并且在挂载前先添加路由表
guard();
app.use(router)
app.use(ElementPlus, {
    locale: zhCn,
})
app.mount('#app')
app.config.globalProperties.$utils = $utils;
app.config.globalProperties.$echarts = echarts
